<style type="text/css">
    body{
        margin:0px!important;
    }
    .minheight_auto{
        min-height: auto!important;
    }
</style>
{include file="header/index" /}
<!--导航end-->
<div class="homeBox">
    <h2 class="mailTitle">数据台</h2>
    <div class="console_head">
        <div class="head_w25">
        	<div class="color-red console-item">
        		<div class="console-icon">
                    <img src="__IMG__/console_1.png">
	        	</div>
	        	<p>
	                <span>今日结算积分</span>
	        	</p>
				<p>
	                <span style="font-size:28px;">{$data.today_money}</span>
	            </p>
        	</div>
        </div>
        <div class="head_w25">
        	<div class="color-yellow console-item">
        		<div class="console-icon ">
                    <img src="__IMG__/console_1.png">
	        	</div>
	        	<p>
	                <span>今日兑换积分</span>
	        	</p>
				<p>
	                <span style="font-size:28px;">{$data.today_cash_money}</span>
	            </p>
        	</div>
        </div>
        <div class="head_w25">
        	<div class="color-green  console-item">
        		<div class="console-icon">
                    <img src="__IMG__/console_0.png">
	        	</div>
	        	<p>
	                <span>今日新增市场推广</span>
	        	</p>
				<p>
				  <span style="font-size:28px;">{$data.today_add_workers}</span>
	            </p>

        	</div>
        </div>
        <div class="head_w25">
        	<div class="color-blue console-item">
        		<div class="console-icon">
                    <img src="__IMG__/console_3.png">
	        	</div>
	        	<p>
	                <span>今日新增工程人员</span>
	        	</p>
	        	<p>
	                <span style="font-size:28px;">{$data.today_add_engineers}</span>
	            </p>
        	</div>
        </div>
    </div>

    <div class="headTwo">
        <div class="maliTwo">
            <div class="inlay">
                <div class="inlName">{$data.total_money}</div>
                <div class="inlPrice">结算总积分/分</div>
            </div>
        </div>
        <div class="maliTwo">
            <div class="inlay">
                <div class="inlName">{$data.total_cash_money}</div>
                <div class="inlPrice">兑换总积分/分</div>
            </div>
        </div>
        <div class="maliTwo">
            <div class="inlay">
                <div class="inlName">{$data.total_workers}</div>
                <div class="inlPrice">市场推广总数/人</div>
            </div>
        </div>
        <div class="maliTwo">
            <div class="inlay" style="border:none">
                <div class="inlName">{$data.total_engineers}</div>
                <div class="inlPrice">工程人员总数/人</div>
            </div>
        </div>
    </div>
	<div class="canvasBox">
		<div class="canvas_75">
			<div class="chart-item">
				<div class="chart-head">
					<ul id="chartTap">
                        <li class="active" data-type="order_chart">结算走势图</li>
					</ul>
				</div>
				<div class="chart-body">
                    <div id="order_chart" style="width: 100%;height: 450px;"></div>
					<div id="money_chart" style="width: 100%;height: 450px;display: none;"></div>
				</div>
			</div>
            <div class="chart-item">
                <div class="chart-head">
                    <ul id="chartTap">
                        <li class="active" data-type="work_orders_chart">兑换走势图</li>
                    </ul>
                </div>
                <div class="chart-body">
                    <div id="work_orders_chart" style="width: 100%;height: 450px;"></div>
                    <div id="order_measure_chart" style="width: 100%;height: 450px;display: none;"></div>
                </div>
            </div>
		</div>
		<div class="canvas_25">
            <div class="catalogue_show">业绩排行榜</div>
            <div class="list-item">
                <!--市场推广、工程人员-->
                {if(!empty($data.workers_rank) || !empty($data.engineers_rank))}
                <div class="list-head">
                    <ul id="listWorkOrderTap">
                        <li class="active" data-type="workers_list">市场推广</li>
                        <li data-type="workOrdermoneys_list">工程人员</li>
                    </ul>
                </div>
                {/if}
                <div class="list-body minheight_auto">
				   <ul id="workers_list">
                       {if(!empty($data.workers_rank))}
                       {volist name="$data.workers_rank" id="v" key="k"}
                            <li>{$k}、{$v.workers_name}<b class="redcolor"> {$v.money}</b>积分</li>
                       {/volist}
                       {/if}
                   </ul>
                    <ul id="workOrdermoneys_list" style="display: none;">
                        {if(!empty($data.engineers_rank))}
                        {volist name="$data.engineers_rank" id="v" key="k"}
                            <li>{$k}、{$v.engineers_name}<b class="redcolor"> {$v.money}</b>积分</li>
                        {/volist}
                        {/if}
                    </ul>
                </div>

                <!--省级承包商、区县级承包商-->
                {if(!empty($data.operation_rank) || !empty($data.administrative_rank))}
                <div class="list-head">
                    <ul id="listOrderTap">
                        <li class="active" data-type="operation_list">省级承包商</li>
                        <li data-type="city_list">市级承包商</li>
                        <li data-type="administrative_list">区级承包商</li>
                    </ul>
                </div>
                {/if}
                <div class="list-body minheight_auto">
                    <ul id="operation_list">
                        {if(!empty($data.operation_rank))}
                        {volist name="$data.operation_rank" id="v" key="k"}
                        <li>{$k}、{$v.company_name}<b class="redcolor"> {$v.money}</b>积分</li>
                        {/volist}
                        {/if}
                    </ul>
                    <ul id="city_list" style="display: none;">
                        {if(!empty($data.city_rank))}
                        {volist name="$data.city_rank" id="v" key="k"}
                        <li>{$k}、{$v.company_name}<b class="redcolor"> {$v.money}</b>积分</li>
                        {/volist}
                        {/if}
                    </ul>
                    <ul id="administrative_list" style="display: none;">
                        {if(!empty($data.administrative_rank))}
                        {volist name="$data.administrative_rank" id="v" key="k"}
                        <li>{$k}、{$v.company_name}<b class="redcolor"> {$v.money}</b>积分</li>
                        {/volist}
                        {/if}
                    </ul>
                </div>

            </div>
		</div>
	</div>

</div>


<script>

    function deteleCon(obj){
        $(obj).parents(".console-top").remove()
    }
    //省级承包商
    $("#listOrderTap li").click(function(){
        $(this).addClass('active');
        $(this).siblings().removeClass('active');
        var dataType = $(this).attr('data-type');
        $("#"+dataType).show();
        $("#"+dataType).siblings().hide();
    })
    //区县级承包商
    $("#listWorkOrderTap li").click(function(){
        $(this).addClass('active');
        $(this).siblings().removeClass('active');
        var dataType = $(this).attr('data-type');
        $("#"+dataType).show();
        $("#"+dataType).siblings().hide();
    })
    //员工
	$("#listTap li").click(function(){
		$(this).addClass('active');
		$(this).siblings().removeClass('active');
		var dataType = $(this).attr('data-type');
		$("#"+dataType).show();
		$("#"+dataType).siblings().hide();
	})

	$("#chartTap li").click(function(){
		$(this).addClass('active');
		$(this).siblings().removeClass('active');
		var dataType = $(this).attr('data-type');
		$("#"+dataType).show();
		$("#"+dataType).siblings().hide();
	})


    // 近七天的日期
    var seven = ['{$data.seven[0]}','{$data.seven[1]}','{$data.seven[2]}','{$data.seven[3]}',
        '{$data.seven[4]}','{$data.seven[5]}','{$data.seven[6]}'];
    // 走势统计图-----------------------------------------------------------------------------------------------------
    // 近七天的走势数据
    var order_seven = [{$data.seven_day_money[0]},{$data.seven_day_money[1]},
    {$data.seven_day_money[2]},{$data.seven_day_money[3]},
    {$data.seven_day_money[4]},{$data.seven_day_money[5]},{$data.seven_day_money[6]}];
    var order_chart = document.getElementById('order_chart');
    var orderChart = echarts.init(order_chart);
    var orderOption = {
        tooltip: {},
        legend: {
            show: false,
            data:['结算数']
        },
        xAxis: {
            boundaryGap: false,
            data: seven
        },
        yAxis: {
            splitLine: {
                lineStyle: {
                    color: '#efefef'
                }
            }
        },
        series: [{
            name: '结算积分',
            type: 'line',
            lineStyle: {
                color: '#86c7e8'
            },
            itemStyle: {
                color: '#86c7e8'
            },
            data: order_seven
        }]
    }
    orderChart.setOption(orderOption);
    var can_w = $("#order_chart").width();
    console.log(can_w)


    // 走势统计图----------------------------------------------------------------------------------------------------
    var daySeven = ['{$data.seven[0]}','{$data.seven[1]}','{$data.seven[2]}','{$data.seven[3]}',
        '{$data.seven[4]}','{$data.seven[5]}','{$data.seven[6]}'];
    // 近七天的走势数据
    var seven_value = [{$data.seven_day_cash_money[0]},{$data.seven_day_cash_money[1]},
    {$data.seven_day_cash_money[2]},{$data.seven_day_cash_money[3]},
    {$data.seven_day_cash_money[4]},{$data.seven_day_cash_money[5]},
    {$data.seven_day_cash_money[6]}];
    var work_orders_chart = document.getElementById('work_orders_chart');
    var work_ordersChart = echarts.init(work_orders_chart);
    var mwork_ordersOption = {
        tooltip: {},
        legend: {
            show: false,
            data:['兑换记录数']
        },
        xAxis: {
            boundaryGap: false,
            data: seven
        },
        yAxis: {
            splitLine: {
                lineStyle: {
                    color: '#efefef'
                }
            }
        },
        series: [{
            name: '兑换积分',
            type: 'line',
            lineStyle: {
                color: '#89F7C1'
            },
            itemStyle: {
                color: '#89F7C1'
            },
            data: seven_value
        }]
    }
    work_ordersChart.setOption(mwork_ordersOption);

    var cano_w = $("#work_orders_chart").width();
    console.log(cano_w)


</script>
</body>
</html>
